﻿@using Lehnet.Models
@model List<Lehnet.Models.MusteriPersonel>
@{Html.RenderPartial("FancyRequireScripts");}
<script>
    function CloseAndUpdate() {

        parent.jQuery.fancybox.close();
    }
    function confirmDelete(musteriPersonelId) {
        if (confirm("Kaydı silmek istediğinizden emin misiniz?") == false)
            return;
        DeleteMusteriPersonelAjax(musteriPersonelId);
    }
    function DeleteMusteriPersonelAjax(musteriPersonelId) {
        $.ajax({
            url: '/MusteriPersoneli/DeleteMusteriPersoneliAjax',
            data: {
                musteriPersonelId: musteriPersonelId
            },
            dataType: 'json',
            contentType: 'application/json; charset=utf-8',
            success: function (data) {
                location.reload(true);
            }
        });
    }
</script>
<link rel="stylesheet" type="text/css" href="/Content/css/GuzelTable.css" />
<div style="width: 100%; text-align: right;">
    <a href="#" title="Kapat" onclick="CloseAndUpdate()">
        <input type="button" value="Kapat" /></a>
</div>
<a href="@Url.Action("Create", "MusteriPersoneli", new { musteriId = @ViewBag.MusteriId })">
    <img src="/Content/IconImages/plus.png" /></a>
@{
    <table class="bordered">
        <thead>
            <tr>
                <th>Ad</th>
                <th>Soyad</th>
                <th>Email1</th>
                <th>Gorev</th>
                <th>Kullanıcı Adı</th>
                <th>Şifre</th>
                <th>Değiştir</th>
                <th>Sil</th>
            </tr>
        </thead>
        @foreach (MusteriPersonel mp in Model)
        {
            <tr>
                <td>@mp.Ad</td>
                <td>@mp.Soyad</td>
                <td>@mp.EMail1</td>
                <td>@mp.Gorev</td>
                <td>@mp.KullaniciAdi</td>
                <td>@mp.Sifre</td>
                <td><a href="@Url.Action("Create", "MusteriPersoneli", new { id = @mp.Id, musteriId = @ViewBag.MusteriId })">Değiştir</a></td>
                <td><a href="#" onclick="confirmDelete(@mp.Id)">sil</a></td>
            </tr>
        }
    </table>
}
